function show_win(){
	
    Ext.QuickTips.init();  
    Ext.form.Field.prototype.msgTarget = 'side';
    var bd = Ext.getBody();
    var re = Ext.ComponentMgr.get("ggg").getSelectionModel().getSelected();
    var fsf = new Ext.FormPanel({
        labelWidth: 150, 
        frame:true,
        bodyStyle:'padding:5px 7px 0',
        width: 460,
        height:310, 
        region: 'center',
        defaults: {
            width: 210
        },
        defaultType: 'textfield',           
        items :[{
            xtype : 'hidden',
            id: 'paraid',
            fieldLabel: '参数编号',
            name: 'paraid',
            blankText:'此项必填',
            allowBlank : false,
            emptyText : '请输入参数编号'
        },{
        	xtype:'hidden',
            id: 'repid',
            fieldLabel: '所属指标',
            name: 'repid',
            blankText:'此项必填，只能输入数字',
            allowBlank : false,
            emptyText : '请输入所属指标'
           // xtype : 'numberfield'
        },{
            id: 'paraname',
            fieldLabel: '参数名称 ',
            name: 'paraname',
            blankText:'此项必填',
            allowBlank : false,
            emptyText : '请输入参数名称'
        },{
            id: 'sourcedep',
            fieldLabel: '来源部门',
            name: 'sourcedep',
            blankText:'此项必填',
            allowBlank : false,
            emptyText : '请输入来源部门'
        },{
            id: 'contactor',
            fieldLabel:'联系人',
            name: 'contactor',
            blankText:'此项必填',
            allowBlank : false,
            emptyText : '请输入联系人'
        },{
            id: 'paraunit',
            fieldLabel:'参数单位',
            name: 'paraunit',
            blankText:'此项必填',
            allowBlank : false,
            emptyText : '请输入参数单位'
        },
         new Ext.form.ComboBox( {
            fieldLabel : "更新频率",
            emptyText : '请选择更新频率',
            blankText:'此项必选',
            id : 'updatatime',
            editable : false,
            triggerAction : 'all',
            store:[
                        ['1','年'],
                        ['2','季'],
                        ['3','月'],
                        ['4','周'],
                        ['5','日'],
                        ['6','时']
                    ],
            mode : 'remote',
            valueField : 'value',
            displayField : 'text'
        }) ,
          new Ext.form.ComboBox( {
            fieldLabel : "是否存在",
            emptyText : '请选择是否存在',
            blankText:'此项必选',
            id : 'issaved',
            editable : false,
            triggerAction : 'all',
            store:[
                        ['0','不存在'],
                        ['1','存在']
                    ],
            mode : 'remote',
            valueField : 'value',
            displayField : 'text'
        }) 
//        {
//            id: 'updatatime',
//            fieldLabel:'更新频率',
//            name: 'updatatime',
//            blankText:'此项必填',
//            allowBlank : false,
//            emptyText : '请输入更新频率'
//        },{
//            id: 'issaved',
//            fieldLabel:'是否存在',
//            name: 'issaved',
//            blankText:'此项必填',
//            allowBlank : false,
//            emptyText : '请输入是否存在'
//        }
        ]
       
    });
   
    var win1 = new Ext.Window({
            
        title: '指标参数信息',            
        closable:true,
        width:460,
        height:350,
        plain:true,
        layout: 'border',
        tbar : ['-', 
       {
            text:'保存',
            handler : function() {
                saveForm();		
            }
        },{
            text:'关闭',
            handler : function() {
                win1.close();
            }
        }
        ],
        items: [fsf]
    });  
     
    Ext.ComponentMgr.get("repid").setValue(re.data.repid);
    formStore = new Ext.data.Store(['paraid', 'repid','paraname','sourcedep','contactor','paraunit','updatatime ','issaved']);
       
    //保存
    function saveForm() {	
        var paraid=Ext.ComponentMgr.get("paraid").getValue();
        var repid=Ext.ComponentMgr.get("repid").getValue();
        var paraname=Ext.ComponentMgr.get("paraname").getValue();
        var sourcedep=Ext.ComponentMgr.get("sourcedep").getValue();
        var contactor=Ext.ComponentMgr.get("contactor").getValue();
        var paraunit=Ext.ComponentMgr.get("paraunit").getValue();
        var updatatime=Ext.ComponentMgr.get("updatatime").getValue();
        var issaved=Ext.ComponentMgr.get("issaved").getValue();
        
        if(repid == null  || repid == ""){
            Ext.Msg.alert('提示','所属指标不能为空！');
        }else if(paraname == null  || paraname == ""){
            Ext.Msg.alert('提示','参数名称不能为空！');
        }else if(sourcedep == null  || sourcedep == ""){
            Ext.Msg.alert('提示','来源部门不能为空！');
        }else if(contactor == null  || contactor == ""){
            Ext.Msg.alert('提示','联系人不能为空！');
        }else if(paraunit == null  || paraunit == ""){
            Ext.Msg.alert('提示','参数单位不能为空！');
        }else if(updatatime == null  || updatatime == ""){
            Ext.Msg.alert('提示','更新频率不能为空！');
        }else if(issaved == null  || issaved == ""){
            Ext.Msg.alert('提示','是否存在不能为空！');
        }else{
            formStore.paraid = paraid;
            formStore.repid = repid;
            formStore.paraname = paraname;
            formStore.sourcedep = sourcedep;
            formStore.contactor = contactor;
            formStore.paraunit = paraunit;
            formStore.updatatime = updatatime;
            formStore.issaved = issaved;

            var saveItemInfoUrl = "";
            saveItemInfoUrl = '?className=cn.com.jsepc.rep.report.reportGrid';
            saveItemInfoUrl += '&methodName=checkId';
            saveItemInfoUrl += '&paramCount=0';

            saveItemInfoUrl = basePath + 'JarpListener' + saveItemInfoUrl;
            httpR_itemInfo = getXMLHttpRequest();
            httpR_itemInfo.onreadystatechange = returnItemSave;
            httpR_itemInfo.open("POST", saveItemInfoUrl, true);
            httpR_itemInfo.send(Ext.util.JSON.encode(formStore));
        } 
    }
    function returnItemSave() {
        if (httpR_itemInfo.readyState == 4) {
            if (httpR_itemInfo.status == 200) {
                ret = httpR_itemInfo.responseText;
                if (ret=='ok'){
                    Ext.MessageBox.show({
                        title:'提示框',
                        msg: ' 保存成功 ',                
                        buttons:{
                            'yes':'确定'
                        },
                        fn: showResult
                    });
                    function showResult(btn){
                        if(btn=='yes'){
                            window.location.reload();
                            Ext.ComponentMgr.get("paraid").setValue("");
                            Ext.ComponentMgr.get("repid").setValue("");
                            Ext.ComponentMgr.get("paraname").setValue("");
                            Ext.ComponentMgr.get("sourcedep").setValue("");
                            Ext.ComponentMgr.get("contactor").setValue("");
                            Ext.ComponentMgr.get("paraunit").setValue("");
                            Ext.ComponentMgr.get("updatatime").setValue("");
                            Ext.ComponentMgr.get("issaved").setValue("");
                            var a=Ext.ComponentMgr.get("crp");
                        //    a.store.reload();
                        }
                    }
                }else{
                    Ext.Msg.alert('提示','保存失败！');
                }
            }
        }
    }  
    
    win1.show(this);
}





